<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="java.util.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.szhelper.com/jsp/html" prefix="chtml"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<%
	String url_key = com.hengpeng.common.constant.Constant.URL_KEY;
	String url_value = (String) request.getAttribute(url_key);
	Long time = com.hengpeng.common.constant.Constant.REDIRECT_TIME;

%>
<title>操作成功提示</title>
<chtml:link rel="stylesheet" href="/layout/css/window.css" />
<script type="text/javascript">
	var seconds = parseInt(
<%=time%>
	) / 1000;
	function sub() {
		seconds--;
		if (seconds > 0) {
			document.getElementById("second").innerHTML = seconds;
			setTimeout(sub, 1000);
		} else {
			if (seconds >= 0) {
				document.getElementById("second").innerHTML = seconds;
			}
			document.getElementById("success_info_form").submit();
		}

	}
</script>
<style type="text/css">
.success_content {
	font-size: 14px;
	width: 98%;
	margin: 20px auto;
	text-align: center;
	background: #fff;
	line-height: 32px;
}

.red {
	color: red;
}

.return_mess {
	font-weight: 800;
}

.return_mess a {
	text-decoration: underline;
	color: red;
	font-size: 14px;
}

.return_mess a:hover {
	text-decoration: none;
	color: green;
}

.suc_mess {
	font-weight: 800;
	color: green;
}
</style>
</head>
<body>
	<chtml:window title="操作成功！">
		<div class="success_content">
			<form id="success_info_form"
				action="<%=request.getContextPath() + url_value%>" method="post"
				style="font-size: 14px;">
				<%
					String message = (String) request.getAttribute(com.hengpeng.common.constant.Constant.MESSAGE);
					if (message == null || message.length() <= 0)
					{
						out.println("系统处理成功。");
					}
					else
					{
						out.println("<div class='suc_mess'>"+ message +"</div>");
					}
					if (url_value != null && url_value.length() > 0)
					{
						out.println("<div class='return_mess'>");
						out.println("系统将<span id='second' class='red'>"+(time/1000)+"</span>秒后自动返回。");
						out.println("<a href='#' onclick='javascript:document.getElementById(\"success_info_form\").submit();'><b>立即返回</b></a>");
						out.println("</div>");
					}
					if (request.getAttribute(com.hengpeng.common.constant.Constant.PARAMS_KEY) != null)
					{
						@SuppressWarnings("unchecked")
						Map<String, Object> params = (Map<String, Object>) request
								.getAttribute(com.hengpeng.common.constant.Constant.PARAMS_KEY);
						Set<String> set = params.keySet();
						for (String _key : set)
						{
							Object value = params.get(_key);
							out.println("<input type='hidden' name='" + _key + "' value='" + value + "' />");
						}
					}
				%>
			</form>
		</div>
		<script type="text/javascript">
			setTimeout(sub, 1000);
		</script>
	</chtml:window>
</body>
</html>